home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network CD 1
/
Network CD.iso
/
tbag
/
1-10
/
tb5
/
doc-files
/
utilities-doc
/
blackbook.doc
< prev
next >
Wrap
Text File
|
1987-01-22
|
5KB
|
175 lines
------------------------------------
*** Little Black Book © 1987 Lcc ***
------------------------------------
This program is presented in the spirit of keeping shareware alive.
You may freely copy and distribute, for non-commercial purposes, both
Little Black Book and the limited file handler library (bfile.lib) provided
that this documentation accompanies the programs and that no charge is made
for copying and distribution.
If you find these programs useful please send your contribution to the
address below. If you desire the full-blown bfile library on disk complete
with source code (bfile is written in 'C' and is not Amiga specific) -
Please send the nominal fee of $30¹ to:
Craig Nelson
Log Cabin Computer
921 Arcola Ct PP
Granbury, TX 76048
¹ A bona fide job offer may be substituted for cash as this programmer is
currently unemployed (817) 573-7304.
Notes, caveats and stuff
--------------------------
Little Black Book:
------------------
* Because of special keyboard/mouse handling, runs only under WorkBench
release 1.2 (this does not apply to bfile.lib)
* Set up for 80 column because that's my preference
* If the display flashes it's either your imagination or the beginning or
end of file has been reached
* For the most part, either the keyboard or the mouse may be used
interchangeably - you'll get the idea just by playing around
<Right Mouse> move pointer to the bottom of window
<RETURN> when the pointer is at the bottom of window enters
edit mode
<CTRL><RETURN> exits edit mode
<Right AMIGA><Q> restores a field
<Right AMIGA><X> clears a field
<Right Cursor> next record
<Left Cursor> previous record
F1 - 'FND' finds the first occurence > or = to entry typed
(the record key is upper case so 'johnson' = 'JOHNSON')
F2 - 'SAV' saves changes made to an existing record
F3 - 'ADD' adds a new record
F4 - 'DEL' deletes a record
bfile.lib:
----------
* bfile.lib is a B+ tree ISAM file handling package written in 'C'
* The limited version has the following restrictions:
- 1 data file
- Max record length = 512 bytes
- Max number of entries = 32K
- 1 index file
- Max key length = 32 bytes
- provides only limited error checking
* A brief synopsis of the supported functions is as follows:
Given -
typedef char BFILE[100];
external int BFILE_OK;
BFILE DataFile, IndexFile;
char FileName[], RecordBuffer[], RecordKey[];
int RecordLength, RecordNumber, KeyLength, Duplicates;
* Create a new data file
MakeFile(&DataFile,&FileName,RecordLength);
* Open an existing data file
OpenFile(&DataFile,&FileName,RecordLength);
* Close a data file
CloseFile(&DataFile);
* Add a new data record
AddRec(&DataFile,&RecordNumber,&RecordBuffer);
* Delete a data record
DeleteRec(&DataFile,RecordNumber);
* Read a data record
GetRec(&DataFile,RecordNumber,&RecordBuffer);
* Write a data record
PutRec(&DataFile,RecordNumber,&RecordBuffer);
* Return the total number of records in a file (including deleted records)
FileRecs(&DataFile);
* Return the total number of records in a file that are in use
UsedRecs(&DataFile);
* Create a new index file
MakeIndex(&IndexFile,&FileName,KeyLength,Duplicates);
* Open an existing index file
OpenIndex(&IndexFile,&FileName,KeyLength,Duplicates);
* Close an index file
CloseIndex(&IndexFile);
* Add a key to an index file
AddKey(&IndexFile,RecordNumber,&RecordKey);
* Delete a key from an index file
DeleteKey(&IndexFile,&RecordNumber,&RecordKey);
* Reset an index file to the beginning
StartKey(&IndexFile);
* Return the key and record number that exactly matches the specified key
FindKey(&IndexFile,&RecordNumber,&RecordKey);
* Return the key and record number that is < or = to the specified key
SearchKey(&IndexFile,&RecordNumber,&RecordKey);
* Return the next key and record number
NextKey(&IndexFile,&RecordNumber,&RecordKey);
* Return the previous key and record number
PrevKey(&IndexFile,&RecordNumber,&RecordKey);
(Most functions set BFILE_OK to TRUE if no error occurred and FALSE if
there was an error)
- - -